-
-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infra(unicorn): permanently disable no-object-as-default-parameter #3203
Conversation
I'm actually not sure which variant I prefer. |
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3203 +/- ##
==========================================
- Coverage 99.96% 99.96% -0.01%
==========================================
Files 2805 2805
Lines 217098 217098
Branches 971 966 -5
==========================================
- Hits 217025 217013 -12
- Misses 73 85 +12 |
The alternative solution would actually "catch" accidental I compressed the signature for simplicitiy sake:
I jsut wanted to point that out. |
You could say the same for other methods such as Line 107 in af1dbcd
|
Also AFAICT:
faker/src/modules/helpers/index.ts Line 1087 in af1dbcd
(That method doesn't follow our usual options deconstruction though) |
I also don't have a strong preference. Just want to point out according to #3215 (comment) the faker.lorem.* methods are some of the most heavily used in Faker so we should be very careful not to accidentally change runtime behavior even if it's a subtle change for a edge case. |
Ref: #2439
Permanently disables the [
unicorn/disable no-object-as-default-parameter
](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/disable no-object-as-default-parameter.md) lint rule.We assume that our users use typescript so they would always pass all required parameters.
Even if they don't all our methods handle that with basic defaults.
Affected code:
Alternative Solution
Change the implementation of the methods to not use signature level defaults.